Dockerfile: update golangci-lint to v2.9.0 and fix linting#6789
Merged
thaJeztah merged 9 commits intodocker:masterfrom Feb 12, 2026
Merged
Dockerfile: update golangci-lint to v2.9.0 and fix linting#6789thaJeztah merged 9 commits intodocker:masterfrom
thaJeztah merged 9 commits intodocker:masterfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
d380bb6 to
a934c75
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the golangci-lint version to v2.9.0 and resolves linting issues identified by the updated linter. The changes primarily focus on optimizing slice allocations by preallocating capacity where the final size is known, which improves performance and memory efficiency. The PR also includes cleanup of nolint directives and minor code refactoring.
Changes:
- Updated golangci-lint version from v2.6.1 to v2.9.0 in Dockerfile.lint
- Preallocated slices with known capacity throughout the codebase to satisfy the
prealloclinter - Removed unnecessary
nolint:preallocandnolint:perfsprintdirectives where code now satisfies the linter - Added
nolint:preallocdirectives in test files where preallocation would over-complicate test initialization
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dockerfiles/Dockerfile.lint | Updated golangci-lint version from v2.6.1 to v2.9.0 |
| opts/swarmopts/secret.go | Preallocated secrets slice with capacity based on o.values length |
| opts/swarmopts/config.go | Preallocated configs slice with capacity based on o.values length |
| opts/mount.go | Preallocated mounts slice with capacity based on m.values length |
| opts/gpus.go | Preallocated gpus slice with capacity based on o.values length |
| internal/volumespec/volumespec.go | Preallocated buffer with spec length capacity; use buffer[:0] to reset |
| cli/connhelper/ssh/ssh.go | Removed nolint:perfsprint directive (no longer needed) |
| cli/compose/loader/merge.go | Preallocated slices in multiple converter functions based on map length |
| cli/compose/convert/service.go | Added early nil return for empty preferences; preallocated slices; moved refs declaration after validation |
| cli/command/system/events.go | Preallocated keys and attrs slices with known capacities |
| cli/command/swarm/opts.go | Preallocated externalCAs slice with capacity based on m.values length |
| cli/command/stack/loader.go | Moved dicts computation after loader.Load success; preallocated dicts slice |
| cli/command/service/update.go | Removed nolint:prealloc directive (no longer needed) |
| cli/command/service/progress/progress_test.go | Added nolint:prealloc directives for test data initialization; changed slice composite literals |
| cli/command/service/list_test.go | Preallocated matrix slice with capacity based on tests length |
| cli/command/image/build_test.go | Changed to var declaration for headers; preallocated names slice after getting headers length |
| cli/command/formatter/container.go | Removed nolint:prealloc directive (no longer needed) |
| cli-plugins/manager/cobra.go | Added nolint:prealloc directive for simple slice initialization |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vvoland
approved these changes
Feb 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)